package com.ruoyi.common;

import com.ruoyi.utils.FileUtils;
import com.ruoyi.web.model.AppResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class MyCommonController {
    @RequestMapping("/common/uploadToOss")
    public AppResult<String> uploadToOss(@RequestParam("file") MultipartFile file) throws Exception {
        return AppResult.success("上传成功",FileUtils.uploadUtils(file, "file"));
    }
}
